﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;
using System.Windows.Forms;

namespace JudoTec.cls
{
    class ConexionMySQL
    {
        public static MySqlConnection IniciarConexion()
        {
            try
            {
                MySqlConnection conexion = new MySqlConnection();
                conexion.ConnectionString =
                    "database= judotec;server= localhost; user id=judotecadmin; pwd=judotec";
                conexion.Open();

                return conexion;
            }
            catch (MySqlException)
            {
                MessageBox.Show("Ocurrio un error al conectar a la BD", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return null;
            }
        }
        
    }
}
